import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.asymmetric.RSA;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
//import org.springframework.util.StringUtils;

import java.nio.charset.StandardCharsets;
import java.util.Arrays;

@Slf4j
public class RsaDemo {
    public static void main(String []args){
        RSA rsa = new RSA("MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==",null);
        System.out.println(rsa);
        String password = new String(rsa.decrypt("Lbg/8v5g+9ghQT8BaxzS1GD1+Qd2ssskM681Iwq3JIOvNV0qCj2lwKOUW4abMA9NvcGFP+UIUHKGyaDeFOhfMw==", KeyType.PrivateKey));
        System.out.println(password);
        //进行StringUtils工具测试
        log.info("测试");
        //System.out.println(StringUtils.isEmpty(""));
        //java
        String []strs = {"abc","haha"};
        //System.out.println("未定义的变量："+ StringUtils.isBlank(strs[5]));
       // System.out.println("未定义的变量："+StringUtils.isEmpty(strs[5]));
        //StringU
        System.out.println("null值："+ StringUtils.isBlank(null));
        System.out.println("布尔值："+StringUtils.isBlank("0"));
        (new RsaDemo()).func1("abc","nihao");
    }

    private String func1(String ...myStr){
        System.out.println(Arrays.toString(myStr));
        return "";
    }
}
